//
// Created by liushuai on 12/21/19.
//
<<<<<<< HEAD:cxx/algorithm/src/mypow.cc
double mypow(double x,int n){
    if(n<0)
        return 1/mypow(x,-n);
    if(n == 0)
        return 1;
    double half = mypow(x,n/2);
    if(n%2 == 0)
        return half*half;
    else
        return half*half*x;
=======
double mypow(double x, int n) {
  if (n < 0) return 1 / mypow(x, -n);
  if (n == 0) return 1;
  double half = mypow(x, n / 2);
  if (n % 2 == 0)
    return half * half;
  else
    return half * half * x;
>>>>>>> dev:cxx/algorithm/common/src/mypow.cc
}
